/**     
* @Title: ShrioRedisCacheManager.java   
* @Package com.yitong.spring.shiro   
* @Description: TODO   
* @author xaoyaoyao
* @date 2017年7月22日 下午2:23:04
*/  
package com.yitong.spring.shiro;

import org.apache.shiro.cache.AbstractCacheManager;
import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheException;
import org.springframework.data.redis.core.RedisTemplate;

/**   
* @ClassName: ShrioRedisCacheManager   
* @Description: TODO   
* @author xaoyaoyao
* @date 2017年7月22日 下午2:23:04   
*      
*/
public class ShrioRedisCacheManager extends AbstractCacheManager {
	
    private RedisTemplate<byte[], Object> redisTemplate;
	
	public ShrioRedisCacheManager(RedisTemplate<byte[], Object> redisTemplate) {
		this.redisTemplate = redisTemplate;
	}

	@Override
	protected Cache<byte[], Object> createCache(String name) throws CacheException {
		return new ShrioRedisCache<byte[], Object>(redisTemplate, name);
	}
}
